home *** CD-ROM | disk | FTP | other *** search
- /* TCHK 0.50 - Howard Kapustein's Turbo C library 11-18-87 */
- /* Copyright (C) 1987, Howard Kapustein. All rights reserved. */
-
- /* video.h - header file for VIDEO.C - screen output routines */
-
- #include <howard.h>
-
- #ifndef VIDEO
- #define VIDEO 0x10 /* VIDEO INTerrupt service = 16 (HEX 10) */
- #define MODE *((byte far *) 0x449lu) /* current video mode */
- #define PAGE *((byte far *) 0x462lu) /* current display page */
- #define PAGELEN *((unsigned int far *) 0x44Clu) /* current page length (regen buffer) */
- #define VIDOFFSET *((unsigned int far *) 0x44Elu) /* offset from start of video */
- #define ROWCOUNT *((byte far *) 0x484lu) /* # rows minus 1 on display (EGA,PGA) */
- #define CHARHEIGHT *((unsigned int far *) 0x485lu) /* character height: # bytes/char, # scan lines/char (EGA,PGA) */
- #define CURSOR_UNDERBAR (MODE==7)?0x0B0C:0x0607 /* cursor type: underbar (default) */
- #define CURSOR_HALFBLOCK (MODE==7)?0x070C:0x0407 /* cursor type: half-block */
- #endif
-
- /* function prototypes */
- void cls(void);
- void clear(int top, int left, int bottom, int right);
- void gotoxy(int x, int y);
- byte wherex(void); /* returns X-coord of cursor */
- byte wherey(void); /* returns Y-coord of cursor */
- void read_mode(byte *width, byte *mode, byte *page);
- void set_mode(byte mode);
- int box(int top, int left, int bottom, int right, byte frame[]);
- void horiz_line(byte c, unsigned int len, byte row, byte col);
- void vert_line(byte c, unsigned int len, byte row, byte col);
- void putk(byte c);
- void putstr(byte *c); /* INTerrupt output */
- void putsay(byte row, byte col, byte *c); /* direct screen writes */
- unsigned int read_cursor(byte *row, byte *col); /* returns CX reg, scan lines */
- void set_cursor(byte start, byte end); /* set cursor scan lines */
- void cursor_off(void);
- void cursor_on(void);
- void cursor_flip(unsigned int curs1, unsigned int curs2); /* toggle cursor type */
- void set_color(byte colors);
- boolean isMDA(void);
- boolean isHerc(void);
- boolean isEGA(void);
- boolean isCGA(void);
- void save_screen(byte *buffer); /* saves screen to buffer */
- void save_box(byte top, byte left, byte bottom, byte right, byte *buffer);
- void restore_screen(byte *buffer); /* restores screen from buffer */
- void restore_box(byte top, byte left, byte bottom, byte right, byte *buffer);
- void scroll_up(byte top, byte left, byte bottom, byte right);
- void scroll_down(byte top, byte left, byte bottom, byte right);
-
-
- #ifndef ismono()
- #define ismono() isMDA()|isHerc()
- #define iscolor() !ismono()
- #endif
-
-
- /* The following global variables have been defined in the library:
-
- byte frame1[9] = {'┌','─','┐','│','┘','─','└','│','\0'};
- byte frame11[5] = {'┬','├','┴','┤','┼'};
- byte frame12[6] = {'╓','╞','╨','╡','╫','╪'};
- byte frame2[9] = {'╔','═','╗','║','╝','═','╚','║','\0'};
- byte frame21[6] = {'╤','╟','╧','╢','╪','╫'};
- byte frame22[5] = {'╦','╠','╩','╣','╬'};
- byte frame0[9] = {' ',' ',' ',' ',' ',' ',' ',' ','\0'};
-
- */
-